# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-getmac
pkgname=('python2-getmac' 'python-getmac')
_pkgname=getmac
pkgver=0.9.5
pkgrel=2
pkgdesc='Get MAC addresses of remote hosts and local interfaces.'
arch=('any')
url='https://pypi.org/project/getmac/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('d3ab0fdf6a346949802df2be9b908daf4234fcf375bd2570d2f1440d326ed6314337685c3a0788ba943c337f6c110838db383ae7283df3f2ac288b70a44b9454')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-getmac() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-getmac() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

